<%--
  Created by IntelliJ IDEA.
  User: 我爱陈果果
  Date: 2020/8/17
  Time: 9:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--导入标签和访问路径--%>
<%@ include file="../_linkPages/basePath.jsp"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta charset="utf-8" />
    <title>显示用户信息</title>
    <%--导入头部的样式和脚本--%>
    <%@ include file="../_linkPages/staticHeader.jsp"%>
    <link rel="stylesheet" href="assets/css/bootstrap.min.css" />
    <link rel="stylesheet" href="assets/css/font-awesome.min.css" />
    <link rel="stylesheet" href="assets/css/ace-fonts.css" />
    <link rel="stylesheet" href="assets/css/ace.min.css" id="main-ace-style" />

    <style type="text/css">
        .CSSearchTbl{ border:1px #008CD4 solid;}
        .CSSearchTbl thead{}
        .CSSearchTbl thead tr{}
        .CSSearchTbl thead tr th{  text-align:left; padding-left:10px;}
        .CSSearchTbl tbody{}
        .CSSearchTbl tbody tr{}
        .CSSearchTbl tbody tr td{  padding: 10px;}
        .table-responsive{ display: block;}

    </style>
</head>

<body class="no-skin">
<!-- #section:basics/navbar.layout -->
<div id="navbar" class="navbar navbar-default">

    <div class="navbar-container" id="navbar-container">
        <button type="button" class="navbar-toggle menu-toggler pull-left" id="menu-toggler">
            <span class="icon-bar"></span>

            <span class="icon-bar"></span>

            <span class="icon-bar"></span>
        </button>

        <div class="navbar-header pull-left">
            <!-- #section:basics/navbar.layout.brand -->
            <a href="index.html" class="navbar-brand">
                <small>
                    <img src="assets/avatars/logo.png" alt="" />
                </small>
            </a>
        </div>

        <!-- #section:basics/navbar.dropdown -->
        <div class="navbar-buttons navbar-header pull-right" role="navigation">
            <%--右边个人信息部分--%>
            <%@ include file="../_linkPages/rightBar.jsp"%>
        </div>
        <!-- /section:basics/navbar.dropdown -->
    </div><!-- /.navbar-container -->
</div>

<!-- /section:basics/navbar.layout -->
<div class="main-container" id="main-container">

    <div id="sidebar" class="sidebar responsive">
        <%--左边导航栏--%>
        <%@ include file="../_linkPages/leftBar.jsp"%>
    </div>
    <!-- /section:basics/sidebar -->
    <div class="main-content">
        <div class="breadcrumbs" id="breadcrumbs">
            <ul class="breadcrumb">
                <li>
                    <i class="ace-icon fa fa-home home-icon"></i>
                    <a href="${basePath}user?method=toIndex">首页</a>
                </li>
                <li>
                    <a href="javascript:void(0)">猫咪管理</a>
                </li>
                <li>
                    <a href="javascript:;">猫咪帖子</a>
                </li>
            </ul><!-- /.breadcrumb -->

        </div>
        <div class="page-content">

            <!-- /section:settings.box -->
            <div class="page-content-area">

                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <div class="row">
                            <div class="col-xs-12">
                                <%@ include file="../_linkPages/msg.jsp"%>
                                <div class="table-header">
                                    品种信息管理
                                </div>

                                <table width="100%" class="CSSearchTbl" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td class="left">
                                            <button class="btn btn-white btn-info btn-bold" onclick="location.href='${basePath}catPost?method=index'">
                                                <i class="ace-icon fa fa-check bigger-120 blue"></i>
                                                以处理
                                            </button>
                                        </td>
                                        <td class="left">
                                            <button class="btn btn-white btn-danger btn-bold" onclick="location.href='${basePath}catPost?method=indexF'">
                                                <i class="ace-icon fa fa-plus bigger-120 danger"></i>
                                                未处理
                                            </button>
                                        </td>

                                    </tr>
                                </table>

                                <div class="table-responsive">

                                    <table id="sample-table-2" class="table table-striped table-bordered table-hover">
                                        <thead>
                                        <tr>
                                            <td>标题</td>
                                            <td>喵咪品种</td>
                                            <td>待售数量</td>
                                            <td>图片1</td>
                                            <td>图片2</td>
                                            <td>图片3</td>
                                            <td>图片4</td>
                                            <td>操作</td>
                                        </tr>
                                        </thead>

                                        <tbody>
                                        <c:forEach items="${catPosts}" var="catPosts">
                                        <tr>

                                            <td style="vertical-align: middle;">
                                                    ${catPosts.posttitle}
                                            </td>
                                            <td style="vertical-align: middle;">${catPosts.catbreed}</td>
                                            <td style="vertical-align: middle;">${catPosts.dsnum}</td>
                                            <td style="vertical-align: middle;">
                                                <img height="100px" src="${basePath}catPost?method=showPic&pic=${catPosts.pic1}"/>
                                            </td>
                                            <td style="vertical-align: middle;">
                                                <img height="100px" src="${basePath}catPost?method=showPic&pic=${catPosts.pic2}"/>
                                            </td>
                                            <td style="vertical-align: middle;">
                                                <img height="100px" src="${basePath}catPost?method=showPic&pic=${catPosts.pic3}"/>
                                            </td>
                                            <td style="vertical-align: middle;">
                                                <img height="100px" src="${basePath}catPost?method=showPic&pic=${catPosts.pic4}"/>
                                            </td>
                                            <td style="vertical-align: middle;">
                                                <div class="hidden-sm hidden-xs btn-group">
                                                    <c:if test="${catPosts.state eq 'F'}">
                                                        <button class="btn btn-xs btn-info" onclick="update('${catPosts.id}')">
                                                            <i class="ace-icon fa fa-check bigger-120"></i>
                                                        </button>
                                                    </c:if>
                                                    <button class="btn btn-xs btn-danger" onclick="delUser('${catPosts.id}')">
                                                        <i class="ace-icon fa fa-trash-o bigger-120"></i>
                                                    </button>

                                                </div>
                                            </td>
                                        </tr>
                                        </c:forEach>
                                        </tbody>
                                    </table>

                                    <div class="modal-footer no-margin-top">
                                        <%--分页信息--%>
                                        <%@ include file="../_linkPages/CatPost.jsp"%>
                                    </div>

                                </div>
                            </div>
                        </div>
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content-area -->
        </div><!-- /.page-content -->
    </div><!-- /.main-content -->

    <div class="footer">
        <%@ include file="../_linkPages/footer.jsp"%>
    </div>

    <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
        <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
    </a>
</div><!-- /.main-container -->
<script>
    $(function () {

    })
    function delUser(id) {
        //$("#bootbox-options-del")
        //var obj = document.getElementById("bootbox-options-del");
        //console.log(obj);
        console.log(123)
        bootbox.dialog({
            message: "<div class='row'><div class='col-sm-12'><span class='bigger-110'>提示：删除后数据不可恢复，请谨慎操作！！！</span></div></div>",
            buttons:
                {
                    "danger" :
                        {
                            "label" : "确定删除",
                            "className" : "btn-sm btn-danger",
                            "callback": function() {
                                window.location.href = "${basePath}catPost?method=del&id="+id;
                            }
                        },
                    "click" :
                        {
                            "label" : "取消",
                            "className" : "btn-sm btn-primary",
                            "callback": function() {

                            }
                        }
                }
        });
    }

    function update(id) {
        //$("#bootbox-options-del")
        //var obj = document.getElementById("bootbox-options-del");
        //console.log(obj);
        bootbox.dialog({
            message: "<div class='row'><div class='col-sm-12'><span class='bigger-110'>提示：确认通过发布吗！</span></div></div>",
            buttons:
                {
                    "danger" :
                        {
                            "label" : "确定发布",
                            "className" : "btn-sm btn-danger",
                            "callback": function() {
                                window.location.href = "${basePath}catPost?method=update&id="+id;
                            }
                        },
                    "click" :
                        {
                            "label" : "取消",
                            "className" : "btn-sm btn-primary",
                            "callback": function() {

                            }
                        }
                }
        });
    }
    function downPic(pic) {
        window.location.href="${basePath}user?method=downPic&pic="+pic;
    }



</script>

<script src="assets/js/ace-extra.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>

<script src="assets/js/jquery.dataTables.min.js"></script>
<script src="assets/js/jquery.dataTables.bootstrap.js"></script>

<!-- ace scripts -->
<script src="assets/js/ace-elements.min.js"></script>
<script src="assets/js/ace.min.js"></script>

<script src="assets/js/bootbox.min.js"></script>
</body>
</html>

